package com.tanhua.server.controller;

import com.tanhua.server.interceptor.UserHolder;
import com.tanhua.server.service.SettingsService;
import com.tanhua.server.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/users/phone")
public class PhoneController {

    @Autowired
    private SettingsService settingsService;
    @Autowired
    private UserService userService;

    @PostMapping("/sendVerificationCode")
    public ResponseEntity sendVericationCode(){
        String mobile = UserHolder.getUser().getMobile();
        userService.sendValidateCode(mobile);
        return ResponseEntity.ok(null);
    }
}
